<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

	<ui:composition template="/layout/masterLayout.xhtml">  	
		<ui:define name="content">
	    	<h:form>
			    <p:fileUpload fileUploadListener="#{shareBean.upload}" mode="advanced" dragDropSupport="false"  
                  multiple="true" sizeLimit="90000000" fileLimit="10"  />  			
			</h:form>
			
			<h:form>
				<h:dataTable value="#{shareBean.fileList}" var="v"
					border="1" rows="40" rendered="#{not empty shareBean.fileList}">
					<h:column rendered="#{userBean.instructor}">
						<f:facet name="header">Remove</f:facet>
						<p:commandButton value="Remove"  ajax="false" action="#{shareBean.remove}" icon="ui-icon-closethick">
							<f:setPropertyActionListener target="#{shareBean.fileToDownload}" value="#{v}" />
						</p:commandButton>
					</h:column>					
					<h:column>
						<f:facet name="header">Download</f:facet>
						<p:commandButton value="Download" ajax="false" icon="ui-icon-arrow-1-s">  
						    <f:setPropertyActionListener target="#{shareBean.fileToDownload}" value="#{v}" />
						    <p:fileDownload value="#{shareBean.download}" />  
						</p:commandButton>  
					</h:column>
					<h:column width="100%">
						<f:facet name="header">File</f:facet>
						<h:outputText value="#{v}" />
					</h:column>
				</h:dataTable>			
			</h:form>								
		</ui:define>		
			
	</ui:composition>		
</html>